package com.xuelang.pipeline.client.pipeline.enums;

import lombok.Getter;

/**
 * @author liuyuan.ly
 * @since 2024/8/1 10:00
 */
@Getter
public enum DeployStrategyEnum {

    Rolling_publish("0", "滚动发布"),
    Grayscale_publish("1", "灰度发布");


    private String key;
    private String value;

    DeployStrategyEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static DeployStrategyEnum fromValue(String value) {
        for (DeployStrategyEnum deployStrategyEnum : DeployStrategyEnum.values()) {
            if (deployStrategyEnum.value.equals(value)) {
                return deployStrategyEnum;
            }
        }
        throw new IllegalArgumentException("Invalid value: " + value);
    }
}
